package com.treasure.domain.domain.entity;

import com.treasure.common.exception.ParameterException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * @author sunhongmin
 * @date 2023/11/5 11:37
 * @description
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EmailMessage {
    /**
     * 接收人
     */
    private String receiver;

    public void validate() {
        // check param is not empty
        if (StringUtils.isBlank(receiver)) {
            throw new ParameterException("邮件消息发送参数缺失，请检查");
        }
    }
}
